-- Dominique COLNET and Suzanne COLLIN - colnet@loria.fr
-- http://www.loria.fr/SmallEiffel
--
*/
/*
This file (base.h) is automatically included in the header for all modes
of compilation : -boost, -no_check, -require_check, ...
This file is also included in the header of any cecil file.
*/
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <signal.h>
#include <stddef.h>
#include <stdarg.h>
#include <limits.h>
#include <float.h>
#include <setjmp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#ifndef O_RDONLY
#include <sys/file.h>
#endif
#ifndef O_RDONLY
#define O_RDONLY 0000
#endif
/*
On Linux glibc systems, we need to use sig.* versions of jmp_buf,
setjmp and longjmp to preserve the signal handling context.
Currently, the way I figured to detect this is if _SIGSET_H_types has
been defined in /usr/include/setjmp.h.
*/
#ifdef _SIGSET_H_types
# define JMP_BUF sigjmp_buf
# define SETJMP(x) sigsetjmp( (x), 1)
# define LONGJMP siglongjmp
#else
# define JMP_BUF jmp_buf
# define SETJMP(x) setjmp( (x) )
# define LONGJMP longjmp
#endif
/*
Type to store reference objects Id :
*/
typedef int Tid;
typedef struct S0 T0;
struct S0{
Tid id;
};
/*
The default channel used to print runtime error messages :
*/
#define SE_ERR stderr
/*
Eiffel type INTEGER is #2 :
*/
typedef int T2;
#define M2 (0)
#define T2BITS (CHAR_BIT*sizeof(int))
#define T2MIN INT_MIN
#define T2MAX INT_MAX
/*
Eiffel type CHARACTER is #3 :
*/
typedef char T3;
#define M3 (0)
#define T3BITS CHAR_BIT
#define T3MIN (0)
#define T3MAX (255)
/*
Eiffel type REAL is #4 :
*/
typedef float T4;
#define M4 (0.0)
#define T4BITS (CHAR_BIT*sizeof(float))
#define T4MIN (-(FLT_MAX))
#define T4MAX FLT_MAX
/*
Eiffel type DOUBLE is #5 :
*/
typedef double T5;
#define M5 (0.0)
#define T5BITS (CHAR_BIT*sizeof(double))
#define T5MIN (-(DBL_MAX))
#define T5MAX DBL_MAX
/*
Eiffel type BOOLEAN is #6 :
*/
typedef int T6;
#define M6 (0)
#define T6BITS (CHAR_BIT*sizeof(int))
/*
Eiffel type POINTER is #8 :
*/
typedef void* T8;
#define M8 (NULL)
#define T8BITS (CHAR_BIT*sizeof(void*))
/* --- Mangling Table Start ---
D 2 T149 R BOOLEAN_CONSTANT 152,151
A 1 T156 R BIT_CONSTANT 156
A*1 T90 R TAG_NAME 90
A 1 T260 R TYPE_BIT_1 260
A*1 T57 R ARRAY[CREATION_CLAUSE] 57
D 2 T296 R ARRAY[LOCAL_ARGUMENT1] 175,169
A*1 T199 R E_ENSURE 199
A 1 T205 R ARRAY[MANIFEST_STRING] 205
A 1 T115 R CALL_INFIX_PLUS 115
A 1 T204 R E_DEBUG 204
A 1 T197 R CST_ATT_INTEGER 197
A 1 T153 R CHARACTER_CONSTANT 153
A 1 T267 R ASSIGNMENT 267
A*1 T54 R RUN_CONTROL 54
A*1 T306 R INDEX_LIST 306
A*1 T301 R EXPORT_ITEM 301
A*1 T49 R CLASS_NAME 49
A*1 T53 R DICTIONARY[STRING,STRING] 53
A 1 T333 E NATIVE_ARRAY[E_REQUIRE] 333
A 1 T320 E NATIVE_ARRAY[RUN_CLASS] 320
A 1 T9 E NATIVE_ARRAY[CHARACTER] 9
A 1 T91 E NATIVE_ARRAY[ASSERTION] 91
A 1 T82 E NATIVE_ARRAY[E_FEATURE] 82
A 1 T223 E NATIVE_ARRAY[WHEN_ITEM] 223
A 1 T295 R DECLARATION_GROUP 295
A*1 T271 R E_REQUIRE 271
A 1 T40 E NATIVE_ARRAY[POSITION] 40
A 1 T234 R CREATION_CALL_2 234
A 1 T102 R CALL_INFIX_XOR 102
A 1 T158 R INTEGER_CONSTANT 158
A 1 T254 R TYPE_POINTER 254
A 1 T252 R TYPE_INTEGER 252
A 1 T262 R TYPE_BIT_2 262
A 1 T327 R FIXED_ARRAY[TYPE_BIT_REF] 327
A*1 T68 R FIXED_ARRAY[FEATURE_NAME] 68
A 1 T121 R INFIX_NAME 121
A 1 T283 R NATIVE_JVM_INVOKESTATIC 283
A*1 T28 R SYSTEM_TOOLS 28
A 1 T265 R TYPE_FORMAL_GENERIC 265
A 1 T154 R MANIFEST_STRING 154
A 1 T171 R FORMAL_ARG_LIST 171
A*1 T44 R DICTIONARY[BASE_CLASS,STRING] 44
A 1 T345 R RUN_FEATURE_2 345
A*1 T67 R FEATURE_NAME_LIST 67
A*1 T86 R CLASS_INVARIANT 86
A*1 T179 R CLASS_NAME_LIST 179
A 1 T177 R IMPLICIT_CURRENT 177
D 8 T198 R ROUTINE 291,290,288,287,276,275,272,270
A*1 T92 R TMP_NAME 92
D 17 T144 R INSTRUCTION 268,267,238,236,234,231,228,216,215,206,209,161,147,146,202,148,204
A 1 T230 R LOOP_VARIANT_1 230
A*1 T51 R EIFFEL_PARSER 51
A 1 T96 R CALL_INFIX_IMPLIES 96
A 1 T358 R RUN_FEATURE_11 358
A 1 T148 R PROC_CALL_N 148
A 1 T259 R TYPE_EXPANDED 259
A 1 T355 E NATIVE_ARRAY[ADDRESS_OF] 355
A 1 T48 E NATIVE_ARRAY[BASE_CLASS] 48
A 1 T95 E NATIVE_ARRAY[EXPRESSION] 95
A 1 T181 E NATIVE_ARRAY[CLASS_NAME] 181
A*1 T79 R ARRAY[FEATURE_CLAUSE] 79
A 1 T175 R ARRAY[ARGUMENT_NAME1] 175
A 1 T186 R FIXED_ARRAY[INTEGER_CONSTANT] 186
A 1 T128 R CALL_PREFIX_NOT 128
A 1 T202 R E_CHECK 202
D 2 T137 R ABSTRACT_RESULT 138,139
A 1 T139 R ORDINARY_RESULT 139
A 1 T162 R LOCAL_VAR_LIST 162
A 1 T253 R TYPE_NONE 253
A 1 T104 R CALL_INFIX_OR_ELSE 104
A*1 T245 R ARRAY[TYPE] 245
A 1 T276 R EXTERNAL_FUNCTION 276
A 1 T349 E NATIVE_ARRAY[BOOLEAN] 349
D 7 T273 R NATIVE 277,285,280,278,282,281,283
A 1 T46 E NATIVE_ARRAY[INTEGER] 46
D 2 T226 R LOOP_VARIANT 229,230
A 1 T344 E NATIVE_ARRAY[RUN_FEATURE_6] 344
A 1 T341 E NATIVE_ARRAY[RUN_FEATURE_5] 341
A*1 T42 R SMALL_EIFFEL 42
A 1 T236 R CREATION_CALL_3 236
A*1 T45 R FIXED_ARRAY[INTEGER] 45
A 1 T106 R CALL_INFIX_AND_THEN 106
A 1 T314 R RUN_FEATURE_3 314
A 1 T281 R NATIVE_WITHOUT_CURRENT 281
A 1 T131 R SIMPLE_FEATURE_NAME 131
A 1 T257 R TYPE_CLASS 257
A 1 T125 R PREFIX_NAME 125
A 1 T140 R E_VOID 140
A*1 T70 R RENAME_PAIR 70
A 1 T300 R FROZEN_FEATURE_NAME 300
A*1 T36 R STD_OUTPUT 36
A 1 T6 E BOOLEAN 6
D 6 T249 R TYPE_BASIC_EIFFEL_EXPANDED 248,255,251,250,252,254
A 1 T229 R LOOP_VARIANT_2 229
A 1 T113 R CALL_INFIX_EQ 113
A 1 T105 R CALL_INFIX_AND 105
A*1 T323 R ARRAY[RUN_FEATURE] 323
A*1 T71 R ARRAY[RENAME_PAIR] 71
A 1 T169 R ARRAY[LOCAL_NAME1] 169
A*1 T303 R ARRAY[EXPORT_ITEM] 303
A*1 T293 R ARRAY[DECLARATION] 293
A*1 T7 R STRING 7
A 1 T151 R E_TRUE 151
A*1 T16 R INTEGER_REF 16
A 1 T129 R E_OLD 129
A 1 T299 R WRITABLE_ATTRIBUTE 299
A 1 T246 E NATIVE_ARRAY[TYPE] 246
A 1 T337 R RUN_FEATURE_4 337
A*1 T264 R ARRAY[FORMAL_GENERIC_ARG] 264
A 1 T195 R CST_ATT_REAL 195
A 1 T275 R EXTERNAL_PROCEDURE 275
A*1 T210 R IFTHEN 210
A 1 T187 E NATIVE_ARRAY[INTEGER_CONSTANT] 187
A*1 T83 R CLIENT_LIST 83
A 1 T288 R FUNCTION 288
A*1 T78 R FEATURE_CLAUSE 78
A*1 T66 R UNIQUE_STRING 66
A 1 T238 R CREATION_CALL_4 238
A 1 T266 E NATIVE_ARRAY[FORMAL_GENERIC_ARG] 266
A*1 T52 R PARSER_BUFFER 52
A 1 T103 R CALL_INFIX_OR 103
A 1 T136 R CALL_N 136
A 1 T72 E NATIVE_ARRAY[RENAME_PAIR] 72
A 1 T170 E NATIVE_ARRAY[LOCAL_NAME1] 170
A 1 T317 E NATIVE_ARRAY[RUN_FEATURE] 317
A 1 T304 E NATIVE_ARRAY[EXPORT_ITEM] 304
A 1 T294 E NATIVE_ARRAY[DECLARATION] 294
A 1 T208 E NATIVE_ARRAY[INSTRUCTION] 208
A*1 T69 R RENAME_LIST 69
D 2 T269 R DEFERRED_ROUTINE 270,272
A 1 T2 E INTEGER 2
D 2 T160 R E_PRECURSOR 159,161
A*1 T318 R DICTIONARY[RUN_CLASS,STRING] 318
A*1 T74 R DICTIONARY[E_FEATURE,STRING] 74
A 1 T250 R TYPE_CHARACTER 250
A*1 T59 R PARENT_LIST 59
A*1 T361 R DICTIONARY[TYPE_REF_TO_EXP,STRING] 361
A*1 T357 R DICTIONARY[MANIFEST_STRING,STRING] 357
A*1 T39 R POSITION 39
A 1 T343 R FIXED_ARRAY[RUN_FEATURE_6] 343
A 1 T340 R FIXED_ARRAY[RUN_FEATURE_5] 340
A 1 T120 R CALL_INFIX_FREEOP 120
A 1 T161 R E_PRECURSOR_PROCEDURE 161
A*1 T84 R ID_PROVIDER 84
A*1 T217 R E_WHEN 217
A 1 T189 R CST_ATT_BOOLEAN 189
A 1 T338 R RUN_FEATURE_5 338
A*1 T64 R COMMENT 64
A 1 T346 R PRECURSOR_NAME 346
A 1 T298 R DECLARATION_1 298
A*1 T85 R ASSERTION 85
A 1 T24 E NATIVE_ARRAY[STRING] 24
A 1 T63 E NATIVE_ARRAY[PARENT] 63
A 1 T220 E NATIVE_ARRAY[E_WHEN] 220
A 1 T213 E NATIVE_ARRAY[IFTHEN] 213
A 1 T268 R REVERSE_ASSIGNMENT 268
A 1 T362 R FIXED_ARRAY[TYPE_REF_TO_EXP] 362
A 1 T192 R FIXED_ARRAY[MANIFEST_STRING] 192
A*1 T182 R TMP_FEATURE 182
A 1 T141 R WRITTEN_CURRENT 141
D 3 T145 R PROC_CALL 147,146,148
A*1 T310 R FMT 310
A 1 T3 E CHARACTER 3
A*1 T188 R COUNTER 188
A 1 T290 R ONCE_PROCEDURE 290
D 11 T312 R RUN_FEATURE 358,347,345,342,338,337,314,324,335,329,325
A 1 T8 E POINTER 8
A*1 T37 R ERROR_HANDLER 37
A*1 T60 R PARENT 60
A 1 T228 R E_LOOP 228
A 1 T363 E NATIVE_ARRAY[TYPE_REF_TO_EXP] 363
A 1 T58 E NATIVE_ARRAY[CREATION_CLAUSE] 58
A 1 T297 E NATIVE_ARRAY[LOCAL_ARGUMENT1] 297
A 1 T193 E NATIVE_ARRAY[MANIFEST_STRING] 193
A 1 T122 R CALL_PREFIX_FREEOP 122
A*1 T348 R ARRAY[BOOLEAN] 348
A*1 T155 R ARRAY[INTEGER] 155
D 2 T221 R WHEN_ITEM 225,224
D 5 T65 R FEATURE_NAME 346,300,131,121,125
A 1 T130 R E_STRIP 130
A 1 T138 R ONCE_RESULT 138
A*1 T305 R INDEX_CLAUSE 305
A*1 T263 R FORMAL_GENERIC_ARG 263
A 1 T247 R TYPE_NATIVE_ARRAY 247
A 1 T251 R TYPE_DOUBLE 251
A 1 T196 R CST_ATT_DOUBLE 196
A 1 T183 R CST_ATT_UNIQUE 183
A*1 T350 R MANIFEST_ARRAY_POOL 350
A 1 T342 R RUN_FEATURE_6 342
A 1 T255 R TYPE_REAL 255
A*1 T77 R FEATURE_CLAUSE_LIST 77
A*1 T76 R FORMAL_GENERIC_LIST 76
D 8 T184 R CST_ATT 190,191,194,183,196,189,195,197
A 1 T194 R CST_ATT_BIT 194
A 1 T282 R NATIVE_INLINE_WITHOUT_CURRENT 282
A*1 T334 R RUN_REQUIRE 334
A 1 T116 R CALL_INFIX_DIV 116
A 1 T167 R LOCAL_NAME1 167
A*1 T302 R EXPORT_LIST 302
A 1 T359 R IMPLICIT_CAST 359
A 1 T107 R CALL_INFIX_GT 107
A 1 T109 R CALL_INFIX_LT 109
A*1 T227 R LOOP_INVARIANT 227
A 1 T241 R TYPE_LIKE_CURRENT 241
A*1 T309 R STD_FILE_WRITE 309
A*1 T322 R FIXED_ARRAY[PARENT] 322
A*1 T23 R FIXED_ARRAY[STRING] 23
A*1 T32 R ARRAY[STRING] 32
A*1 T61 R ARRAY[PARENT] 61
A*1 T219 R ARRAY[E_WHEN] 219
A*1 T212 R ARRAY[IFTHEN] 212
A 1 T244 R TYPE_ARRAY 244
D 2 T289 R ONCE_ROUTINE 291,290
A 1 T157 R REAL_CONSTANT 157
A*1 T332 R ARRAY[E_REQUIRE] 332
A*1 T321 R ARRAY[RUN_CLASS] 321
A*1 T88 R ARRAY[ASSERTION] 88
A 1 T164 R LOCAL_NAME2 164
A*1 T222 R ARRAY[WHEN_ITEM] 222
A 1 T335 R RUN_FEATURE_7 335
A 1 T159 R E_PRECURSOR_FUNCTION 159
A 1 T258 R TYPE_GENERIC 258
A*1 T331 R MEMO[COMMENT] 331
A 1 T256 R TYPE_STRING 256
A 1 T248 R TYPE_BOOLEAN 248
D 51 T89 R EXPRESSION 359,174,167,214,96,102,103,104,105,106,107,109,108,110,111,113,114,115,116,117,118,119,178,120,129,177,172,164,159,158,157,156,154,153,152,151,143,122,126,140,131,141,127,139,128,136,133,135,93,138,130
A 1 T278 R NATIVE_WITH_CURRENT 278
A*1 T10 R PRETTY 10
A*1 T356 R MANIFEST_STRING_POOL 356
A*1 T353 R ADDRESS_OF_POOL 353
A 1 T328 E NATIVE_ARRAY[TYPE_BIT_REF] 328
A 1 T73 E NATIVE_ARRAY[FEATURE_NAME] 73
A 1 T308 E NATIVE_ARRAY[INDEX_CLAUSE] 308
D 2 T292 R DECLARATION 298,295
A 1 T215 R E_RETRY 215
A 3 T352 R FIXED_ARRAY[TYPE] 362,352,327
D 2 T274 R EXTERNAL_ROUTINE 275,276
D 2 T261 R TYPE_BIT 262,260
A*1 T34 R STD_ERROR 34
D 2 T163 R DECLARATION_LIST 162,171
A 1 T280 R NATIVE_INLINE_WITH_CURRENT 280
A 1 T118 R CALL_INFIX_INT_DIV 118
A 1 T324 R RUN_FEATURE_8 324
A*1 T339 R ONCE_ROUTINE_POOL 339
A 1 T239 R TYPE_LIKE_FEATURE 239
A 1 T354 R FIXED_ARRAY[ADDRESS_OF] 354
A*1 T47 R FIXED_ARRAY[BASE_CLASS] 47
A 4 T134 R FIXED_ARRAY[EXPRESSION] 354,192,186,134
A*1 T180 R FIXED_ARRAY[CLASS_NAME] 180
A 1 T285 R NATIVE_JVM_INVOKEVIRTUAL 285
A 1 T178 R CALL_INFIX_POWER 178
A*1 T33 R ECHO 33
A 1 T146 R PROC_CALL_0 146
A 1 T80 E NATIVE_ARRAY[FEATURE_CLAUSE] 80
A 1 T176 E NATIVE_ARRAY[ARGUMENT_NAME1] 176
A*1 T307 R ARRAY[INDEX_CLAUSE] 307
A 1 T242 R TYPE_LIKE_ARGUMENT 242
A 1 T191 R CST_ATT_STRING 191
A*1 T319 R FIXED_ARRAY[RUN_CLASS] 319
A*1 T81 R FIXED_ARRAY[E_FEATURE] 81
A 1 T93 R MANIFEST_ARRAY 93
A 1 T272 R DEFERRED_FUNCTION 272
A*1 T351 R DICTIONARY[TYPE,INTEGER] 351
A 1 T277 R NATIVE_SMALL_EIFFEL 277
A*1 T56 R CREATION_CLAUSE 56
A 1 T224 R WHEN_ITEM_1 224
A*1 T336 R EXCEPTIONS_HANDLER 336
A 1 T135 R CALL_1_C 135
A 1 T133 R CALL_0_C 133
A*1 T55 R CREATION_CLAUSE_LIST 55
A*1 T313 R RUN_CLASS 313
A 1 T216 R E_INSPECT 216
A 1 T174 R ARGUMENT_NAME1 174
A 1 T147 R PROC_CALL_1 147
A 1 T117 R CALL_INFIX_INT_REM 117
A 3 T316 R FIXED_ARRAY[RUN_FEATURE] 343,340,316
A*1 T201 R FIXED_ARRAY[INSTRUCTION] 201
D 22 T62 R TYPE 360,326,265,262,260,259,258,257,256,255,254,253,252,251,250,248,247,244,243,242,241,239
A*1 T218 R WHEN_LIST 218
A 1 T329 R RUN_FEATURE_9 329
D 2 T168 R LOCAL_ARGUMENT1 174,167
A*1 T203 R CHECK_INVARIANT 203
D 17 T75 R E_FEATURE 299,291,290,288,287,276,275,272,270,197,196,195,194,191,190,189,183